package com.hjm.suanfa.美团;

import java.io.*;
import java.util.*;

public class 并查集 {

    public static void main(String[] args) throws IOException {
        BufferedReader in  = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st  = new StringTokenizer(in.readLine(), " ");

        int n = Integer.parseInt(st.nextToken()); // 人数
        int m = Integer.parseInt(st.nextToken()); // 初始朋友关系数
        int q = Integer.parseInt(st.nextToken()); // 操作数

        // —— 2. 读入初始 m 条关系，并收集所有出现过的节点编号 ——
        int[][] initEdges = new int[m][2];
        HashSet<Integer> nodes = new HashSet<>(m + 2 * q);
        for (int i = 0; i < m; i++) {
            st = new StringTokenizer(in.readLine(), " ");
            int u = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            initEdges[i][0] = u;
            initEdges[i][1] = v;
            nodes.add(u);
            nodes.add(v);
        }

        // —— 3. 读入 q 个操作，记录删除计数，并收集所有节点 ——
        // ops[i][0]=op, ops[i][1]=u, ops[i][2]=v
        int[][] ops = new int[q][3];
        // 统计每条边被删除的次数
        HashMap<Long, Integer> delCnt = new HashMap<>();
        for (int i = 0; i < q; i++) {
            st = new StringTokenizer(in.readLine(), " ");
            int op = Integer.parseInt(st.nextToken());
            int u  = Integer.parseInt(st.nextToken());
            int v  = Integer.parseInt(st.nextToken());
            ops[i][0] = op;
            ops[i][1] = u;
            ops[i][2] = v;
            nodes.add(u);
            nodes.add(v);
            if (op == 1) {
                long key = makeKey(u, v);
                delCnt.put(key, delCnt.getOrDefault(key, 0) + 1);
            }
        }

        // —— 4. 离散化所有出现的节点编号 ——
        HashMap<Integer, Integer> idx = new HashMap<>(nodes.size());
        {
            int t = 0;
            for (int x : nodes) {
                idx.put(x, t++);
            }
        }
        int N = idx.size();

        // —— 5. 初始化并查集（大小 N）——
        DSU dsu = new DSU(N);

        // —— 6. 将“最终时刻”所有未被删除的初始边 union ——
        for (int[] e : initEdges) {
            long key = makeKey(e[0], e[1]);
            if (!delCnt.containsKey(key)) {
                dsu.unite(idx.get(e[0]), idx.get(e[1]));
            }
        }

        // —— 7. 逆序处理操作 ——
        List<String> ans = new ArrayList<>();
        for (int i = q - 1; i >= 0; i--) {
            int op = ops[i][0], u = ops[i][1], v = ops[i][2];
            int iu = idx.get(u), iv = idx.get(v);
            if (op == 2) {
                // 查询连通性
                ans.add(dsu.find(iu) == dsu.find(iv) ? "Yes" : "No");
            } else {
                // 删除操作在逆序中当作“添加”边
                dsu.unite(iu, iv);
            }
        }

        // —— 8. 正序输出所有查询答案 ——
        for (int i = ans.size() - 1; i >= 0; i--) {
            out.println(ans.get(i));
        }
        out.flush();
    }

    // 统一无向边 (u,v) 的 key
    private static long makeKey(int u, int v) {
        if (u > v) {
            int t = u;
            u = v;
            v = t;
        }
        return ((long)u << 32) | (v & 0xffffffffL);
    }

    // 并查集（带按秩合并）
    static class DSU {
        int[] p, r;
        DSU(int n) {
            p = new int[n];
            r = new int[n];
            for (int i = 0; i < n; i++) p[i] = i;
        }
        int find(int x) {
            return p[x] == x ? x : (p[x] = find(p[x]));
        }
        void unite(int a, int b) {
            a = find(a);
            b = find(b);
            if (a == b) return;
            if (r[a] < r[b]) {
                p[a] = b;
            } else {
                p[b] = a;
                if (r[a] == r[b]) r[a]++;
            }
        }
    }
}
